<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>我的认证页</title>
    <script src="../../script/jquery.min.js" type="text/javascript"></script>
    <script src="../../script/manager/promptManager.js"></script>
    <script src="../../script/timecontrol.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" href="../../css/aui.css"/>
    <link rel="stylesheet" href="../../css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/weui.min.css"/>
    <link rel="stylesheet" href="../../css/personal.css">
    <link rel="stylesheet" href="../../css/CFNetPP_Base.css">
    <link rel="stylesheet" href="../../css/base.css"/>
    <style type="text/css">
        html, body {
            background-color: #f0f0f0;
        }

        select {
            padding: 0.5em;
            font-size: 15px;
            line-height: 1.2em;
        }

        .course-img {
            background-image: url(../../image/course_placehoder.png);
            background-size: 100% 5.4rem;
        }

        .droplist {
            position: absolute;
            width: 200px;
            left: 75px;
            bottom: 0px;
            right: 0px;
            top: 50px;
            border-radius: 0px;
            opacity: 1;
            z-index: 846;
        }

        .mui-table-view-cell {
            width: 200px;
            position: relative;
            overflow: hidden;
            padding: 5px 15px;
            -webkit-touch-callout: none;
        }

        .mui-popover .mui-table-view {
            width: 200px;
            max-height: 100px;
        }

        .span1 {
            float: left
        }

        .weui_select {
            -webkit-appearance: none;
            border: 0;
            outline: 0;
            background-color: transparent;
            width: 65%;
            font-size: 12px;
            height: 26px;
            line-height: 12px;
            position: relative;
            z-index: 1;
            padding-left: 15px;
        }

        .disable * {
            /*opacity: 0.8;*/
            /*color: black;*/
        }

        .disable input {
            visibility: hidden;
        }
    </style>
</head>
<body>
<div id="main" style="margin-top: 0;" class="myApprove">
    <div class="aui-content aui-margin-b-15 bgwhite">
        <ul class="aui-list aui-media-list" id="list_id"></ul>
    </div>
    <div class="noSign" id="noData" hidden="hidden">
        <img src="../../image/icon_img.png" width="60%">
        <p class="font16 top_15 base_dark_grey">
            暂无数据
        </p>
    </div>
    <div class="loadFailure" hidden="hidden" id="noNet">
        <img src="../../image/icon_img01.png" width="60%">
        <p class="">
            数据加载失败
        </p>
        <p>
            请检查您的网络
        </p>
        <button type="button" class="mui-btn mui-btn-outlined" onclick="RefreshData()">
            重新加载
        </button>
    </div>
</div>
<div id="yuyueAlert" class="weui_dialog_confirm" style="display: none;">
    <div class="weui_mask"></div>
    <div class="weui_dialog">
        <div class="weui_dialog_hd">
            <strong class="weui_dialog_title">预约考试</strong>
        </div>
        <div id="yuyueAlert_ll">
            <div class="weui_dialog_bd"><input type="checkbox"/><label>理论考试</label></div>
            <div class="select_timer" class="weui_dialog_bd" style="height: 2.5em">
                <div data-role="fieldcontain" class=" ">
                    <label>考试时间</label>
                    <select class="weui_select" style="float: right;margin-right: 1.5em" id="selectBar"></select>
                </div>
            </div>
        </div>
        <div id="yuyueAlert_other">
            <div class="weui_dialog_bd"><input type="checkbox"/><label>实操考试</label></div>
            <div class="select_timer" class="weui_dialog_bd" style="height: 2.5em">
                <div data-role="fieldcontain" class=" ">
                    <label>考试时间</label>
                    <select class="weui_select" style="float: right;margin-right: 1.5em" id="selectBar2"></select>
                </div>
            </div>
        </div>

        <div class="weui_dialog_ft">
            <a onclick="yuyueNo()" href="#" class="weui_btn_dialog default"
               style="color:white;background-color:#169bd5;border-bottom-left-radius: 10px">取消</a>
            <a onclick="yuyueYes()" href="#" class="weui_btn_dialog primary"
               style="color:white;background-color:#169bd5;border-bottom-right-radius: 10px">确定</a>
        </div>
    </div>
</div>
<div id="StartAlert" class="weui_dialog_confirm" style="display: none;">
    <div class="weui_mask"></div>
    <div class="weui_dialog">
        <div class="weui_dialog_hd">
            <strong class="weui_dialog_title" id="checkNum3"></strong>
        </div>
        <div class="weui_dialog_bd"></div>
        <div class="weui_dialog_ft">
            <a onclick="startNo()" href="#" class="weui_btn_dialog default" style="color:#18b4ed">取消</a>
            <a onclick="startYes()" href="#" class="weui_btn_dialog primary" style="color:#18b4ed">确定</a>
        </div>
    </div>
</div>
<div class="weui_dialog_alert" id="ScoreAlert" style="display: none;font-size: 75%">
    <div class="weui_mask"></div>
    <div class="weui_dialog">
        <div class="weui_dialog_hd">
            <strong class="weui_dialog_title">查看成绩</strong>
        </div>
        <div class="weui_dialog_bd">
            <span class=" font14 ">考核:<span class="left_5"></span></span>
            <span class=" font14">得分:<span class=" left_5" style="color: red"></span></span>
        </div>
        <div class="weui_dialog_ft">
            <a onclick="hideScore()" href="#" class="weui_btn_dialog primary" style="color:#18b4ed">确定</a>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/MD5.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/timeStampTool.js"></script>
<script type="text/javascript" src="../../script/requestTool.js"></script>
<script type="text/javascript" src="../../script/certification.js"></script>
<script type="text/javascript" src="../../script/attachmentManager.js"></script>
<script type="text/javascript">
    var refreshCount = 0;
    //更新数据条数
    var dataArr = new Array();
    var job_id = '';
    var page = 1;
    var row = 10;
    var itemId = '';
    var stime = '';
    var open_type = '';
    var name;

    var click_item = "";
    apiready = function () {
        showProgress();
        setRefreshHeader();
        setPullUpRefresh();
        ReceNotifi();
        loadWeekData();
        loadNewData();
    }

    //加载报名日期数据
    function loadWeekData() {
        var param = {};
        cfnetppPOST(url_applySelectTime, param, true, function (data, status) {
            if (status == 'success') {
                $('#noNet').hide();
                if (data.code == 200) {
                    var list = data.data;
                    var classHtmlString = '';
                    if (list != null && list.length > 0) {
                        for (var i = 0; i < list.length; i++) {
                            var classData = list[i];
                            classHtmlString += htmlStringWithWeek(classData, i);
                        }
                        $('#selectBar').append(classHtmlString);
                        $('#selectBar2').append(classHtmlString);
                        setupClassCellClick();
                    } else {
                        if (page == 1) {
                            $('#noData').show();
                        } else {
                            api.toast({
                                msg: '暂无更多数据',
                                duration: 2000,
                                location: 'bottom'
                            });
                        }
                    }
                } else {
                    if (page == 1) {
                        $('#list_id').html('');
                        $('#noData').show();
                    }
                }
            } else {
                $('#noNet').show();
            }
        });
    }

    function htmlStringWithWeek(classgroup, i) {
        return '<option value="' + (i + 1) + '">' + classgroup.value + '    ' + classgroup.week + '</option>';
    }

    function setupClassCellClick() {
        $("#selectBar").change(function () {
            var checkText = $(this).find("option:selected").text().split(' ')[0];
            stime = timeStampWithString(checkText);
        });
    }

    //接收通知
    function ReceNotifi() {
        api.addEventListener({
            name: 'sendrefreshdata'
        }, function (ret, err) {
            //coding...
            loadNewData();
        });
        api.addEventListener({
            name: 'RreshCertificationListNotifi'
        }, function (ret, err) {
            //coding...
            loadNewData();
        });
        api.addEventListener({
            name: 'RreshMockExamListNotifi'
        }, function (ret, err) {
            //coding...
            loadNewData();
        });
    }

    function loadNewData() {
        page = 1;
        loadData();
    }

    function loadMoreData() {
        page++;
        loadData();
    }

    //请求得到数据
    function loadData() {
        var param = {
            uid: $api.getStorage('cfnetppuid'),
            jid: 52, //集团id
            page: page,
            rows: row,
        };
        cfnetppPOST(url_myApprove, {
            "uid": $api.getStorage('cfnetppuid'),
            "page":page,
            "rows":10,
        } , true, function (data, status) {
//								alert(JSON.stringify(param));
            api.refreshHeaderLoadDone();
            hideProgress();
            if (status == 'success') {
                $('#noNet').hide();
                if (data.code == 200) {
                    var list = data.data.data;
                    var listArr = new Array();
                    var htmlString = new String();
                    if (list != null && list.length > 0) {
                        $('#noData').hide();
                        refreshCount = list.length;
                        if (page == 1) {
                            multiplePicturesCache({
                                picArr: list, //包含图片数组
                                picKey: 'img'//图片对应的字段
                            }, function (imageArr) {
                                list = imageArr;
                                for (var i = 0; i < list.length; i++) {
                                    listArr.push(list[i]);
                                    htmlString += htmlStringWithName(list[i], i);
                                }
                                dataArr = listArr;
                                $('#list_id').html(htmlString);
                            });
                        } else {
                            multiplePicturesCache({
                                picArr: list, //包含图片数组
                                picKey: 'img'//图片对应的字段
                            }, function (imageArr) {
                                list = imageArr;
                                var oldCount = dataArr.length;
                                for (var i = 0; i < list.length; i++) {
                                    var index = oldCount + i;
                                    listArr.push(list[i]);
                                    htmlString += htmlStringWithName(list[i], index);
                                }
                                dataArr = dataArr.concat(listArr);
                                $('#list_id').append(htmlString);
                            });
                        }
                    } else {
                        if (page == 1) {
                            $('#noData').show();
                        } else {
                            api.toast({
                                msg: '暂无更多数据',
                                duration: 2000,
                                location: 'bottom'
                            });
                        }
                    }
                } else {
                    if (page == 1) {
                        $('#list_id').html('');
                        $('#noData').show();
                    }
                }
            } else {
                $('#noNet').show();
            }
        });
    }

    //开始考试，显示输入考试编码弹窗
    function StartTest(i, start_time, id) {
        job_id = id;
        itemId = i;
        TestChoose();
        /*var nowtime = (Date.parse(new Date())) / 1000;
        if (id == 59 || id == 60 || id == 61) {
            if (nowtime >= 1514563200) {
                ShowToast('学霸赛认证岗位预约考试时间已过');
            } else {
                var index = i;
                var start_time = start_time;
                var nowtime = (Date.parse(new Date())) / 1000;
                if (nowtime >= (start_time + 32400) && nowtime <= (start_time + 57600)) {
                    job_id = id;
                    itemId = index;
                    TestChoose();
                } else if (nowtime < (start_time + 32400)) {
                    ShowToast('您的考试时间未到,请在预约日期的9点至16点开始考试');
                } else if (nowtime > (start_time + 57600)) {
                    ShowToast('您的考试时间已过,请重新申请考试');
                }
            }
        } else {
            var index = i;
            var start_time = start_time;
            var nowtime = (Date.parse(new Date())) / 1000;
            if (nowtime >= (start_time + 32400) && nowtime <= (start_time + 57600)) {
                job_id = id;
                itemId = index;
                TestChoose();
            } else if (nowtime < (start_time + 32400)) {
                ShowToast('您的考试时间未到,请在预约日期的9点至16点开始考试');
            } else if (nowtime > (start_time + 57600)) {
                ShowToast('您的考试时间已过,请重新申请考试');
            }else{

              alert('考试时间异常')
            }
        }*/
    }

    function startYes() {
        $('#StartAlert').hide();
        openCertificationExamFrame();
    }

    function startNo() {
        $('#StartAlert').hide();
    }

    //重新报名
    function AgainSignUp(i) {
        var data = dataArr[parseInt(i)];
        $api.setStorage("pay_money", data.apply_money);
        $api.setStorage("jobs", data.quarter);
        SendBehaviorTrajectoriesNotifi1('1', '我的认证列表页', '124', api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title);
        // 支付金额
        api.openWin({
            useWKWebView: true,
            name: 'MyAPPly',
            url: '../Quarters/MyAPPly.html',
            pageParam: {
                quarter_name: data.quarter,
                id: data.id,
                title: data.quarter,
                type: 2,
                sourceurl: window.location.pathname,
                sourcetitle: document.title,
            },
            vScrollBarEnabled: false,
            hScrollBarEnabled: false,
            allowEdit: true,
        });
    }

    //开始学习
    function StartStudy(i) {
        var dataid = i;
        var data = dataArr[parseInt(dataid)];
        var num = parseInt(data.type);
        SendBehaviorTrajectoriesNotifi1('1', '我的认证列表页', '124', api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title);
        if (num != 0) {
            api.openWin({
                useWKWebView: true,
                name: 'WorkStudyWindow',
                url: 'WorkStudyWindow.html',
                pageParam: {
                    quarter_name: data.quarter,
                    id: data.id, //企业id
                    quartercoursetype: data.quartercoursetype,
                    quartercoursetype2: data.quartercoursetype2,
                    sourceurl: window.location.pathname,
                    sourcetitle: document.title
                },
            });
        } else {
            ShowToast('您还未支付,无法查看课程');
        }
    }

    //打开支付页面
    function openPay(i, job_subtype) {
        var data = dataArr[parseInt(i)];
        $api.setStorage("jobs", data.quarter);
        // 岗位名称
        $api.setStorage("pay_money", data.apply_money);
        // 支付金额
        $api.setStorage("jobs_id", data.id);
        // 支付金额
        $api.setStorage("job_subtype", job_subtype);
        SendBehaviorTrajectoriesNotifi1('1', '我的认证列表页', '124', api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title);
        // 岗位id
        api.openWin({
            useWKWebView: true,
            name: 'Upload_Order',
            url: '../Quarters/Upload_Order.html',
            pageParam: {
                quarter_name: data.quarter,
                jobs_id: data.id, //企业id
                xl: data.quarter,
                pay_money: data.apply_money,
                sourceurl: window.location.pathname,
                sourcetitle: document.title
            }
        });
    }

    //预约考试接口   预约考试确定按钮
    function yuyueYes() {
        var times = [];
        if ($('#yuyueAlert_ll input').first().prop("checked")) {
            if (click_item.exam_ll_time_update === 1) {
                if (new Date($('#selectBar').find("option:selected").text().split(' ')[0]).getTime() - new Date().getTime() <= 7 * 24 * 60 * 60 * 1000) {
                    toast("理论考试，请预约七天以后的考试时间");
                    return;
                }
            }
            times.push({
                exam_type: 1,
                starttime: timeStampWithString($('#selectBar').find("option:selected").text().split(' ')[0]),
                applyid: click_item.exam_ll_time_update === 1 ? click_item.exam_ll_time_id : ""
            });
        }
        if ($('#yuyueAlert_other input').first().prop("checked")) {
            var data = {};
            var title;
            data.starttime = timeStampWithString($('#selectBar2').find("option:selected").text().split(' ')[0]);
            if (click_item.exam_type === 1) {
                title = "技能考试";
                data.exam_type = 2;
                data.applyid = click_item.exam_jn_time_update === 1 ? click_item.exam_jn_time_id : ""
            } else if (click_item.exam_type === 2) {
                title = "实操考试";
                data.exam_type = 6;
                data.applyid = click_item.exam_sc_time_update === 1 ? click_item.exam_sc_time_id : ""
            } else {
                title = "系统考试";
                data.exam_type = 7;
                data.applyid = click_item.exam_xt_time_update === 1 ? click_item.exam_xt_time_id : ""
            }
            if (data.applyid !== "") {
                if (new Date($('#selectBar2').find("option:selected").text().split(' ')[0]).getTime() - new Date().getTime() <= 7 * 24 * 60 * 60 * 1000) {
                    toast(title + ",请选择七天以后的考试时间");
                    return;
                }
            }
            times.push(data);
        }
        console.log(JSON.stringify(times));
        if (times.length === 0) {
            toast("请选择考试科目");
            return;
        }

        var param = {
            user_id: $api.getStorage('cfnetppuid'),
            quarter_id: click_item.id,
            times: times
        };
        cfnetppPOST(url_applyTest, param, true, function (data, status) {
            $('#yuyueAlert').hide();
            SendBusinessOperationsLogNotifi('我的认证列表页', '124', param, param, '', data, '认证-申请考试接口', '124-01')
            if (status == 'success') {
                if (data.code == 200) {
                    api.toast({
                        msg: '预约考试成功',
                        duration: 2000,
                        location: 'bottom'
                    });
                    loadNewData();
                } else if (data.code == 131) {
                    api.toast({
                        msg: '没有此岗位',
                        duration: 2000,
                        location: 'bottom'
                    });
                } else if (data.code == 110) {
                    api.toast({
                        msg: '学霸赛认证岗位预约考试时间已过',
                        duration: 2000,
                        location: 'bottom'
                    });
                } else if (data.code == 132) {
                    api.toast({
                        msg: '已经报名过',
                        duration: 2000,
                        location: 'bottom'
                    });
                } else {
                    api.toast({
                        msg: '预约考试失败',
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            } else {
                api.toast({
                    msg: '预约考试失败',
                    duration: 2000,
                    location: 'bottom'
                });
            }
        });
    }

    //显示预约考试弹窗
    function yuyueShow(id, index) {
        click_item = dataArr[parseInt(index)];
        $('#yuyueAlert_ll input').first().prop('checked', false);
        $('#yuyueAlert_other input').first().prop('checked', false);
        $('#yuyueAlert_other label').first().text(click_item.exam_type === 1 ? "技能考试" : click_item.exam_type === 2 ? "实操考试" : "系统考试");
        if (click_item.exam_ll_status === 1 || click_item.exam_ll_status === 3 || click_item.exam_ll_status === 7 || click_item.exam_ll_status === 10 || click_item.exam_ll_status === 12 || click_item.exam_ll_time_update === 1) {
            $('#yuyueAlert_ll label').first().text(click_item.exam_ll_isagain_apply ? "理论考试(补考)" : "理论考试");
            $('#yuyueAlert_ll').css('pointer-events', 'auto');
            $('#yuyueAlert_ll').removeClass('disable');
            $('#yuyueAlert_ll .select_timer').first().css('display', 'block');
        } else {
            $('#yuyueAlert_ll').css('pointer-events', 'none');
            $('#yuyueAlert_ll').addClass('disable');
            $('#yuyueAlert_ll .select_timer').first().css('display', 'none');
            setAlertExamStatus($('#yuyueAlert_ll label').first(), "理论考试", click_item.exam_ll_status);
        }
        if (click_item.exam_type === 1) {
            //技能考试
            if (click_item.exam_jn_status === 1 || click_item.exam_jn_status === 3 || click_item.exam_jn_status === 7 || click_item.exam_jn_status === 10 || click_item.exam_jn_status === 12 || click_item.exam_jn_time_update === 1) {
                $('#yuyueAlert_other label').first().text(click_item.exam_jn_isagain_apply ? "技能考试(补考)" : "技能考试");
                $('#yuyueAlert_other').css('pointer-events', 'auto');
                $('#yuyueAlert_other').removeClass('disable');
                $('#yuyueAlert_other .select_timer').first().css('display', 'block');

            } else {
                $('#yuyueAlert_other').css('pointer-events', 'none');
                $('#yuyueAlert_other').addClass('disable');
                $('#yuyueAlert_other .select_timer').first().css('display', 'none');

                setAlertExamStatus($('#yuyueAlert_other label').first(), "技能考试", click_item.exam_jn_status);
            }
        } else if (click_item.exam_type === 2) {
            //实操考试
            if (click_item.exam_sc_status === 1 || click_item.exam_sc_status === 3 || click_item.exam_sc_status === 7 || click_item.exam_sc_status === 10 || click_item.exam_sc_status === 12 || click_item.exam_sc_time_update === 1) {
                $('#yuyueAlert_other label').first().text(click_item.exam_sc_isagain_apply ? "实操考试(补考)" : "实操考试");
                $('#yuyueAlert_other').css('pointer-events', 'auto');
                $('#yuyueAlert_other').removeClass('disable');
                $('#yuyueAlert_other .select_timer').first().css('display', 'block');
            } else {
                $('#yuyueAlert_other').css('pointer-events', 'none');
                $('#yuyueAlert_other').addClass('disable');
                $('#yuyueAlert_other').addClass('disable');
                $('#yuyueAlert_other .select_timer').first().css('display', 'none');
                setAlertExamStatus($('#yuyueAlert_other label').first(), "实操考试", click_item.exam_sc_status);
            }
        } else {
            //系统 考试
            if (click_item.exam_xt_status === 1 || click_item.exam_xt_status === 3 || click_item.exam_xt_status === 7 || click_item.exam_xt_status === 10 || click_item.exam_xt_status === 12 || click_item.exam_xt_time_update === 1) {
                $('#yuyueAlert_other label').first().text(click_item.exam_xt_isagain_apply ? "系统考试(补考)" : "系统考试");
                $('#yuyueAlert_other').css('pointer-events', 'auto');
                $('#yuyueAlert_other').removeClass('disable');
                $('#yuyueAlert_other .select_timer').first().css('display', 'block');
            } else {
                $('#yuyueAlert_other').css('pointer-events', 'none');
                $('#yuyueAlert_other').addClass('disable');
                $('#yuyueAlert_other').addClass('disable');
                $('#yuyueAlert_other .select_timer').first().css('display', 'none');
                setAlertExamStatus($('#yuyueAlert_other label').first(), "系统考试", click_item.exam_xt_status);
            }
        }
        $('#yuyueAlert').show();
    }

    function setAlertExamStatus(label_obj, before, status) {
        switch (status) {
            case 2:
                label_obj.text(before + "(审核中)");
                break;
            case 4:
            case 5:
            case 6:
                label_obj.text(before + "(考核中)");
                break;
            case 8:
                label_obj.text(before + "(阅卷中)");
                break;
            case 9:
                label_obj.text(before + "(考试已通过)");
                break;
        }
    }

    //预约考试取消按钮
    function yuyueNo() {
        $('#yuyueAlert').hide();
    }

    //打开考试页
    function openCertificationExamFrame() {
        SendBehaviorTrajectoriesNotifi1('1', '我的认证列表页', '124', api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title);
        var data = dataArr[parseInt(itemId)];
        var pageParam = new Object();
        if (open_type == 1) {
            winName = 'MyCertificationTestExam';
            pageParam = {
                id: data.id, //企业id
                quarter_name: data.quarter,
                type: 1,
                check_id: data.check_id,
                exam: data.exam_ll.enumber,
                cid: data.exam_ll.exam_id,
                sourceurl: window.location.pathname,
                sourcetitle: document.title
            };
        } else if (open_type == 2) {
            winName = 'MyCertificationTestExam';
            pageParam = {
                id: data.id, //企业id
                quarter_name: data.quarter,
                type: 2,
                check_id: data.check_id,
                cid: data.exam_jn.exam_id,
                exam: data.exam_jn.enumber,
                sourceurl: window.location.pathname,
                sourcetitle: document.title
            };
        } else if (open_type == 4) {
            winName = 'FieldTestFrame';
            pageParam = {
                id: data.id, //企业id
                quarter_name: data.quarter,
                type: 6,
                check_id: data.check_id,
                exam: data.exam_sc.enumber,
                cid: data.exam_sc.exam_id,
                sourceurl: window.location.pathname,
                sourcetitle: document.title
            };
        }
        api.openWin({
            useWKWebView: true,
            name: winName,
            url: winName + '.html',
            pageParam: pageParam,
            bounces: false,
            vScrollBarEnabled: true,
            hScrollBarEnabled: false,
            slidBackEnabled: false,
            softInputMode: 'pan',
        });
    }

    //考试弹框选择
    function TestChoose() {
        var winh = api.winHeight;
        var winw = api.winWidth;
        var data = dataArr[parseInt(itemId)];
        var itmeArr = [];
        itmeArr.push({
            text: "理论考试",
            icon: data.exam_ll_status === 6 ? 'widget://icon/moni_1.png' : 'widget://icon/moni_1_disable.png'
        });
        if (data.exam_type === 1) {
            itmeArr.push({
                text: "技能考试",
                icon: data.exam_jn_status === 6 ? 'widget://icon/moni-2.png' : 'widget://icon/moni-2_disable.png'
            });
        } else if (data.exam_type === 2) {
            itmeArr.push({
                text: "实操考试",
                icon: data.exam_sc_status === 6 ? 'widget://icon/moni-2.png' : 'widget://icon/moni-2_disable.png'
            });
        } else {
            itmeArr.push({
                text: "系统考试",
                icon: data.exam_xt_status === 6 ? 'widget://icon/moni-2.png' : 'widget://icon/moni-2_disable.png'
            });
        }
        column = 2;
        // if (data.exam_ll == "" && (data.exam_jn == "" || data.exam_jn.exam_id == 0) == "" && data.exam_sc == "") {
        // 	ShowToast('暂无岗位考试');
        // } else if (data.exam_ll != "" && (data.exam_jn == "" || data.exam_jn.exam_id == 0) && data.exam_sc != "") {
        // 	itmeArr = [{
        // 		text : llStr,
        // 		icon : 'widget://icon/moni_1.png'
        // 	}, {
        // 		text : scStr,
        // 		icon : 'widget://icon/moni-2.png'
        // 	}];
        // 	testType = 0;
        // 	column = 2;
        // } else if (data.exam_ll != "" && (data.exam_jn != "" && data.exam_jn.exam_id != 0) && data.exam_sc == "") {
        // 	itmeArr = [{
        // 		text : llStr,
        // 		icon : 'widget://icon/moni_1.png'
        // 	}, {
        // 		text : jnStr,
        // 		icon : 'widget://icon/moni-2.png'
        // 	}];
        // 	testType = 1;
        // 	column = 2;
        // } else if (data.exam_ll != "" && (data.exam_jn == "" || data.exam_jn.exam_id == 0) && data.exam_sc == "") {
        // 	itmeArr = [{
        // 		text : llStr,
        // 		icon : 'widget://icon/moni_1.png'
        // 	}];
        // 	testType = 2;
        // 	column = 1;
        // }else{
        //    alert('考试状态异常');
        // }
        var dialogBox = api.require('dialogBox');
        dialogBox.share({
            rect: {
                w: 0.7 * winw,
                h: 0.3 * winh
            },
            items: itmeArr,
            tapClose: true,
            styles: {
                bg: '#FFF',
                corner: 10,
                column: column,
                horizontalSpace: 15,
                verticalSpace: 30,
                itemText: {
                    color: '#000',
                    size: 15,
                    marginT: 5
                },
                itemIcon: {
                    size: 70
                }
            }
        }, function (ret) {
            if (ret.index === 0) {
                if (data.exam_ll_status !== 6) {
                    return;
                }
                open_type = 1;
            } else if (ret.index === 1) {
                if (data.exam_jn_status !== 6 && data.exam_sc_status !== 6 && data.exam_xt_status !== 6) {
                    return;
                }
                if (data.exam_type === 3) {
                    toast("系统考试请到PC上进行操作");
                    return;
                } else {
                    open_type = data.exam_type === 1 ? 2 : 4;
                }
            }
            dialogBox.close({
                dialogName: 'share'
            });
            $("#checkNum3").html("考试只能进行一次且考试期间不能退出或刷新页面,确认进入考试？");
            $('#StartAlert').show();

            // if (ret.index == 0) {
            // 	if (data.exam_ll != null && data.exam_ll != '') {
            // 		if (data.exam_ll.status == 'pass') {
            // 			ShowToast('您的理论考试已经通过');
            // 		} else if (data.exam_ll.status == 'unpass') {
            // 			ShowToast('您的理论考试未通过,请等待补考');
            // 		} else if (data.exam_ll.loding == "2" && data.exam_ll.jiaojuan == "1") {
            // 			ShowToast('您的理论考试正在审阅中,请耐心等待');
            // 		} else {
            // 			dialogBox.close({
            // 				dialogName : 'share'
            // 			});
            // 			$("#checkNum3").html("考试只能进行一次且考试期间不能退出或刷新页面,确认进入考试？");
            // 			$('#StartAlert').show();
            // 			open_type = 1;
            // 		}
            // 	} else {
            // 		ShowToast('理论考试暂无试卷');
            // 	}
            // } else if (ret.index == 1) {
            // 	//技能考试
            // 	if (testType == 1) {
            // 		if (data.exam_jn.status == 'pass') {
            // 			ShowToast('您的技能考试已经通过');
            // 		} else if (data.exam_jn.status == 'unpass') {
            // 			ShowToast('您的技能考试未通过,请等待补考');
            // 		} else if (data.exam_jn.loding == '2') {
            // 			ShowToast('您的技能考试正在审阅,请耐心等待');
            // 		} else {
            // 			dialogBox.close({
            // 				dialogName : 'share'
            // 			});
            // 			$("#checkNum3").html("考试只能进行一次且考试期间不能退出或刷新页面,确认进入考试？");
            // 			$('#StartAlert').show();
            // 			open_type = 2;
            // 		}
            // 		//实操考试
            // 	} else if (testType == 0) {
            // 		if (data.exam_sc.status == 'pass') {
            // 			ShowToast('您的实操考试已经通过');
            // 		} else if (data.exam_sc.status == 'unpass') {
            // 			ShowToast('您的实操考试未通过,请等待补考');
            // 		} else if (data.exam_sc.status == 'loading') {
            // 			ShowToast('您的实操考试正在审阅中,请耐心等待');
            // 		} else {
            // 			dialogBox.close({
            // 				dialogName : 'share'
            // 			});
            // 			$("#checkNum3").html("考试只能进行一次且考试期间不能退出或刷新页面,确认进入考试？");
            // 			$('#StartAlert').show();
            // 			open_type = 4;
            // 		}
            // 	} else {
            // 	}
            // }
            dialogBox.close({
                dialogName: 'share'
            });
        });
    }

    //选择考核弹窗，点击事件
    function lookScore() {
        $('#ScoreAlert').show();
    }

    //查看成绩弹窗，点击确定，隐藏查看成绩弹窗
    function hideScore() {
        $('#ScoreAlert').hide();
    }
</script>
</html>